package com.kamistoat.meimeichatserveraggrement.protocol.p2p;

import com.kamistoat.meimeichatserveraggrement.protocol.Command;
import com.kamistoat.meimeichatserveraggrement.protocol.Packet;

import java.util.Date;

/**
 * 当通过P2P发送私聊消息时，直接发送该内容给对应的Client
 */
public class UDP_MessageClient2Client extends Packet {
    private String senderId;   // 消息发送者ID[个人]
    private String senderNickname;  // 消息发送者昵称
    private String senderHead;  // 消息发送者头像
    private String receiverId; // 消息接收方ID[对方]
    private String msgText;  // 传输消息内容
    private Integer msgType; // 消息类型；0文字消息、1固定表情
    private Date msgDate;    // 消息时间

    public UDP_MessageClient2Client() {
    }

    public UDP_MessageClient2Client(String senderId, String senderNickname, String senderHead, String receiverId, String msgText, Integer msgType, Date msgDate) {
        this.senderId = senderId;
        this.senderNickname = senderNickname;
        this.senderHead = senderHead;
        this.receiverId = receiverId;
        this.msgText = msgText;
        this.msgType = msgType;
        this.msgDate = msgDate;
    }

    public String getSenderId() {
        return senderId;
    }

    public void setSenderId(String senderId) {
        this.senderId = senderId;
    }

    public String getSenderNickname() {
        return senderNickname;
    }

    public void setSenderNickname(String senderNickname) {
        this.senderNickname = senderNickname;
    }

    public String getSenderHead() {
        return senderHead;
    }

    public void setSenderHead(String senderHead) {
        this.senderHead = senderHead;
    }

    public String getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(String receiverId) {
        this.receiverId = receiverId;
    }

    public String getMsgText() {
        return msgText;
    }

    public void setMsgText(String msgText) {
        this.msgText = msgText;
    }

    public Integer getMsgType() {
        return msgType;
    }

    public void setMsgType(Integer msgType) {
        this.msgType = msgType;
    }

    public Date getMsgDate() {
        return msgDate;
    }

    public void setMsgDate(Date msgDate) {
        this.msgDate = msgDate;
    }

    /**
     * 获取协议指令
     *
     * @return 返回指令值
     */
    @Override
    public Byte getCommand() {
        return Command.UDP_MessageClient2Client;
    }
}
